﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using SATF.DB;

namespace SATF.BI
{
    public class BIUserGroup : BaseItem
    {
        
        #region 所有成员属性

        private string m_group_desc = "";
        public string Group_Desc
        {
            get
            {
                return m_group_desc;
            }
            set
            {
                m_group_desc = value;
                OnPropertyChanged("Group_Desc");
            }
        }

        private UInt64 m_group_role = 0;
        public UInt64 Group_Role
        {
            get
            {
                return m_group_role;
            }
            set
            {
                m_group_role = value;
                OnPropertyChanged("Group_Role");
            }
        }

        private int m_isDeleted = 0;
        public int IsDeleted
        {
            get
            {
                return m_isDeleted;
            }
            set
            {
                m_isDeleted = value;
                OnPropertyChanged("IsDeleted");
            }
        }

        #endregion


        #region 构造方法

        public BIUserGroup()
            : base()
        {

        }

        public BIUserGroup(UInt64 id)
            : base(id)
        {

        }

        public BIUserGroup(string name)
            : base(name)
        {

        }

        public BIUserGroup(DataRow dataRow)
            : base(dataRow)
        {

        }

        #endregion


        #region 基类方法

        public override void SetTableName()
        {
            this.TableName = "user_group";
        }

        public override string GetChildTable()
        {
            return "";
        }

        public override void Fill(DataRow dataRow)
        {
            ID = DBConvert.ToUInt64(dataRow, "ID");
            Name = DBConvert.ToString(dataRow, "Name");
            Group_Role = DBConvert.ToUInt64(dataRow, "Group_Role");
            Group_Desc = DBConvert.ToString(dataRow, "Group_Desc");
            IsDeleted = DBConvert.ToInt32(dataRow, "IsDeleted");
            this.ContentDataRow = dataRow;
        }

        public override void UpdateContentDataRow()
        {
            this.ContentDataRow["Name"] = Name;
            this.ContentDataRow["Group_Role"] = Group_Role;
            this.ContentDataRow["Group_Desc"] = Group_Desc;
            this.ContentDataRow["IsDeleted"] = IsDeleted;
            this.ContentDataRow = this.ContentDataRow;

        }

        public override IList<BaseItem> GetChildren()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion

    }
}
